<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Buying extends My_Controller {

    function __construct() {
        parent::__construct();
    }

    public function index() {
        //data for quick search
        $data['propertyType'] = $this->site->getArray('propertyType', 'Any');
        $data['BedroomCount'] = $this->site->getArray('featuteCount', 'Any');
        $data['BathroomCount'] = $this->site->getArray('featuteCount', 'Any');
        $data['Minprice'] = $this->site->getArray('priceRange', 'Any');
        $data['Maxprice'] = $this->site->getArray('priceRange', 'Any');
        $this->navigation->loadListingsView($data);
    }

    public function listings() {
        //data for quick search
        $data['propertyType'] = $this->site->getArray('propertyType', 'Any');
        $data['BedroomCount'] = $this->site->getArray('featuteCount', 'Any');
        $data['BathroomCount'] = $this->site->getArray('featuteCount', 'Any');
        $data['Minprice'] = $this->site->getArray('priceRange', 'Any');
        $data['Maxprice'] = $this->site->getArray('priceRange', 'Any');
        $data['subTitle'] = 'Properties for Sale';
        $data['type'] = 'listings';


        if ($this->input->post()) {
            $data['seachval_type'] = $this->input->post('type');
            $data['seachval_surroundingSuburbs'] = $this->input->post('surroundingSuburbs');
            $data['seachval_suburbs'] = $this->input->post('suburbs');
            $data['search_propertytype'] = $this->input->post('search_propertytype');
            $data['search_minprice'] = $this->input->post('search_minprice');
            $data['search_maxprice'] = $this->input->post('search_maxprice');
            $data['search_bathroom'] = $this->input->post('search_bathroom');
            $data['search_bedroom']=$this->input->post('search_bedroom');
            $data['suburbs_id'] = $this->input->post('suburbs_id');
            $data['suburbs'] = $this->input->post('suburbs');
            $data['surrounding'] = $this->input->post('surrounding');
            $data['sortBy'] = $this->input->post('sortBy');
            $data['orderBy'] = $this->input->post('orderBy');
        }

        $this->navigation->loadListingsView($data);
    }

	public function house() {
    	$this->navigation->loadHouseView();
	}
}

/* End of file buying.php */
/* Location: ./application/controllers/buying.php */